package com.wanxi.test;

import java.util.Scanner;

public class MySwitch {
    public static void main(String[] args) {
        /**
         * 做一个计算器加减乘除
         * 1.用户录入接口
         * 2.提示用户录入
         * 3.得到用户录入信息
         * 4.判断用户进入到那个条件语句
         * 5.输入语句
         */
        Scanner scanner = new Scanner(System.in);
        System.out.println("请首先输入操作符");
        String operate = scanner.next();
        System.out.println("请输入第1个数字");
        int num1 = scanner.nextInt();
        System.out.println("请输入第2个数字");
        int num2 = scanner.nextInt();
        switch (operate) {
            case "+":
                System.out.println(num1 + num2);
                break;
            case "-":
                System.out.println(num1 - num2);
                break;
            case "*":
                System.out.println(num1 * num2);
                break;
            case "/":
                System.out.println(num1 / num2);
                break;
            default:
                System.out.println("你输入的操作符错误");
                break;
        }
//        int a = 0;
//        switch (a) {
//            case 1,2:
//            case 2:
//                System.out.println(111);
//                break;
//        }
    }
}
